Analysis method of electronic spotting scope for automatically analyzing shooting accuracy

ABSTRACT

The present invention belongs to the technical field of spotting scopes, particularly to an analysis method for automatically analyzing a shooting accuracy, which is applied to an electronic spotting scope. The analysis method includes the following steps: converting an optical image obtained by a spotting scope into an electronic image, extracting a target paper area from the electronic image, and performing pixel-level subtraction on the target paper area and an electronic reference target paper to detect points of impact, calculating a center point of each of the points of impact, and determining a shooting accuracy according to a deviation of the center point of each of the points of impact and a center point of the target paper area. The analysis method provided by the present invention is simple and intuitive, facilitates the interpretation of a result, and does not need a system with too much artificial intervention to replace an existing monotonous high-error spotting system.

TECHNICAL FIELD

The present invention mainly belongs to the technical field of spottingscopes, and particularly to an analysis method of an electronic spottingscope for automatically analyzing a shooting accuracy.

BACKGROUND

In a shooting gallery, a shooting location and a target have a certaindistance therebetween, and a shooting result may not be directly seen byhuman eyes after shooting is performed. In order to observe the shootingresult, there is a conveyer for conveying a target paper to the shootinglocation in the prior art, however, such an approach needs the conveyer,so as to be mostly used in an indoor shooting gallery, not in an outdoorshooting gallery; and conveying the target paper needs to consume acertain time. Under this condition, a spotting scope capable ofrealizing long-range viewing of the shooting result is widely used. Thespotting scope performs projection imaging on a target image (targetpaper) by an optical imaging principle. During using, the target papermay be manually observed by an eyepiece by adjusting a magnification toperform reading to obtain the shooting result.

However, an existing spotting scope has the following shortcomings andinconveniences: (1) because it is a man-made way to judge, readingjudgment errors are more or less caused usually due to different viewingangles, and are especially serious when a small image is observed; (2)in a case where the distance is relatively far, a magnification of thespotting scope in the prior art may not be large enough to support largemagnification imaging; (3) when readings are repeatedly judged by theeyepiece, the long-term use will make an observer feel eye fatigue; (4)when a target is observed, since the eyepiece has a characteristic of anexit pupil distance, it is difficult to find the target for a greenhand, a little eye movement will make a field of view diminish ordisappear; (5), after the data is read, it is limited to brain memory orpaper records, the brain memory will be forgotten for a long time, thepaper records are not conducive to long-term storage and databacktracking, while the paper records can not be timely and convenientlyshared among peer enthusiasts, and contents of the records are onlyboring numbers; and (6) only one person is permitted to observe at thesame time, and for a collective entertainment project, the degree ofparticipation of a bystander or a teammate is greatly reduced, and theinconvenience is brought for many people to observe and discusssimultaneously.

SUMMARY

In view of the above-mentioned problems, the present invention providesan integrated multifunctional electronic spotting scope forautomatically analyzing a shooting accuracy without manual intervention,and an analysis method thereof from a perspective of a use scenario ofthe spotting scope in combination with aspects of image science andimage processing. The spotting scope of this application is simple andintuitive, easily interprets a result, and does not need a system withtoo much artificial intervention to replace an existing monotonoushigh-error spotting system.

The present invention is achieved by the following technical solution.

An analysis method for automatically analyzing a shooting accuracy,which is applied to an electronic spotting scope, the electronicspotting scope performs optical imaging on a target paper and objectsaround it, the analysis method is characterized by comprising thefollowing steps: converting an optical image obtained by the spottingscope into an electronic image, extracting a target paper area from theelectronic image, performing pixel-level subtraction on the target paperarea and an electronic reference target paper to detect points ofimpact, calculating a center point of each of the points of impact, anddetermining the shooting accuracy according to a deviation between thecenter point of each of the points of impact and a center point of thetarget paper area.

Further, wherein performing perspective correction on the target paperarea after the target paper area is extracted corrects an outer contourof the target paper area to a circular contour, and point of impactdetection is performed by using the target paper area subjected toperspective correction.

Further, wherein extracting a target paper area from the electronicimage particularly comprises: performing large-scale mean filtering onthe electronic image to eliminate grid interference on the target paper;segmenting the electronic image into a background and a foreground byusing an adaptive Otsu threshold segmentation method according to a grayproperty of the electronic image; and determining a minimum contour byadopting a vector tracing method and a geometric feature of a Freemanlink code according to the image segmented into the foreground andbackground to obtain the target paper area.

Further, wherein performing pixel-level subtraction on the target paperarea and an electronic reference target paper to detect points of impactparticularly comprises: performing pixel-level subtraction on the targetpaper area and an electronic reference target paper to obtain a pixeldifference image of the target paper area and the electronic referencetarget paper; wherein

a pixel difference threshold of images of a previous frame and afollowing frame is set in the pixel difference image, and a settingresult is 255 when a pixel difference exceeds the threshold, and thesetting result is 0 when the pixel difference is lower than thethreshold; and

the pixel difference image is subjected to contour tracing to obtain apoint of impact contour and a center of the contour is calculated toobtain a center point of each of the points of impact.

Further, wherein the perspective correction particularly comprises:obtaining an edge of the target paper area by using a Canny operator,performing maximum elliptical contour fitting on the edge by using Houghtransform to obtain a maximum elliptical equation, and performingstraight line fitting of cross lines on the edge by using the Houghtransform to obtain points of intersection with an uppermost point, alowermost point, a rightmost point and a leftmost point of the largestelliptical contour, and combining the uppermost point, the lowermostpoint, the rightmost point and the leftmost point of the largestelliptical contour with four points at the same positions in aperspective transformation template to obtain a perspectivetransformation matrix by calculation, and performing perspectivetransformation on the target paper area by using the perspectivetransformation matrix.

Further, wherein the electronic reference target paper is an electronicimage of a blank target paper or a target paper area extracted inhistorical analysis.

Further, wherein the deviation comprises a longitudinal deviation and alateral deviation.

Further, wherein the electronic spotting scope comprises an exteriorstructure, wherein the exterior structure is a detachable structure bodyas a whole, an internal portion of the exterior structure is anaccommodating space with a fixed component, and the accommodating spacewith the fixed component comprises a field of view unit, electro-opticalconversion, a CPU processing unit, a display unit, a power supply and awireless transmission unit.

Further, wherein the electronic spotting scope has an accuracy analysismodule, wherein the accuracy analysis module is configured to analyze ashooting accuracy by adopting the analysis method.

The present invention has advantageous effects that the presentinvention provides an analysis method for automatically analyzing ashooting accuracy, which may be applied to an electronic spotting scope;and the analysis method may automatically analyze the shooting accuracyaccording to historical shooting data.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a flow of an analysis method according tothe present invention;

FIG. 2 is a 8-connected chain code in an embodiment 1 according to thepresent invention;

FIG. 3 is a bitmap in an embodiment 1 according to the presentinvention;

FIG. 4 is a block diagram of a process for extracting a target paperarea according to the present invention;

FIG. 5 is a schematic diagram of non-maximum suppression in anembodiment 2 according to the present invention;

FIG. 6 is a schematic diagram of an original point under a Caresiancoordinate system in an embodiment 2 according to the present invention;

FIG. 7 is a schematic diagram showing any four straight lines passingthrough the original point under a Caresian coordinate system in anembodiment 2 according to the present invention;

FIG. 8 is a schematic diagram of expression of any four straight linespassing through the original point under a polar coordinate system in aCaresian coordinate system in an embodiment 2 according to the presentinvention;

FIG. 9 is a schematic diagram of determining points of intersection ofcross lines L1 and L2 with an ellipse in an embodiment 2 according tothe present invention;

FIG. 10 is a schematic diagram of a perspective transformation diagramin an embodiment 2 according to the present invention;

FIG. 11 is a block diagram of a process for performing target paper areacorrection according to the present invention;

FIG. 12 is a block diagram of a process for performing a point of impactdetection method according to the present invention;

FIG. 13 is a schematic diagram showing functions of an electronicspotting scope in an embodiment 1 according to the present invention;

FIG. 14 is a schematic diagram showing a structure of a spotting scopein an embodiment 1 according to the present invention.

wherein 1. field of view acquisition unit; 2. external leather track; 3.external key; 4. line transmission interface antenna; 5. display unit;6. tripod interface; 7. battery compartment; 8. electro-opticalconversion board; 9. CPU core board; 10. interface board; 11. functionoperation board; 12. display conversion board; 13. battery pack; 14.rotary encoder; and 15. focusing knob.

DETAILED DESCRIPTION

Objectives, technical solutions and advantages of the present inventionwill become more apparent from the following detailed description of thepresent invention when taken in conjunction with accompanying drawings.It should be understood that specific embodiments described herein aremerely illustrative of the present invention and are not intended tolimit the present invention.

Rather, the present invention encompasses any alternatives,modifications, equivalents, and solutions made within the spirit andscope of the present invention as defined by the claims. Further, inorder to give the public a better understanding of the presentinvention, some specific details are described below in detail in thefollowing detailed description of the present invention. It will beappreciated by those skilled in the art that the present invention maybe understood without reference to the details.

Embodiment 1

The present invention provides an electronic spotting scope forautomatically analyzing a shooting accuracy. The spotting scope has anaccuracy analysis module, wherein the accuracy analysis module analyzesthe shooting accuracy by adopting an accuracy analysis method.

Functions of the integrated multifunctional electronic spotting scopesystem based on automatic analysis of a shooting accuracy of the presentinvention are shown in FIG. 13, and its structure is shown in FIG. 14.

The spotting scope may be conveniently mounted on a fixed tripod. Thespotting scope includes an exterior structure, wherein the exteriorstructure is a detachable structure body as a whole, an internal portionof the exterior structure is an accommodating space with a fixedcomponent, and the accommodating space with the fixed component includesa field of view unit, electro-optical conversion, a CPU processing unit,a display unit, a power supply and a wireless transmission unit.

The field of view acquisition unit 1 includes an objective lenscombination or other optical visual device, and the objective lenscombination or the optical visual device is mounted on the front end ofthe field of view acquisition unit 1 to acquire field of viewinformation.

The spotting scope is a digitallizer as a whole, which may communicatewith a smart phone, an intelligent terminal, a sighting apparatus or acircuit and sends video information acquired by the field of viewacquisition unit 1 to the smart phone, the intelligent terminal, thesighting apparatus or the circuit, and the information of the field ofview acquisition unit 1 is displayed by the smart phone, the intelligentterminal or the like. The field of view information in the field of viewacquisition unit 1 is converted by the electro-optical conversioncircuit to obtain video information available for electronic display.The circuit includes an electro-optical conversion board 8 whichconverts a field of view optical signal into an electrical signal, theelectro-optical conversion board 8 is located at the rear end in thefield of view acquisition unit 1, the electro-optical conversion board 8converts the optical signal into the electrical signal, while performingautomatic exposure, automatic white balance, noise reduction andsharpening operation on the signal, so that the signal quality isimproved, and high-quality data is provided for imaging.

The rear end of the electro-optical conversion circuit is connected witha CPU core board 9, and the rear end of the CPU core board 9 isconnected with an interface board 10, particularly, the CPU core board 9is connected with a serial port of the interface board 10 through aserial port, the CPU core board 9 is disposed between the interfaceboard 10 and the electro-optical conversion plate 8, the threecomponents are placed in parallel, and board surfaces are allperpendicular to the field of view acquisition unit 1, and theelectro-optical conversion plate 8 transmits the converted video signalto the CPU core board 9 for further processing through a parallel datainterface, and the interface board 10 communicates with the CPU coreboard 9 through a serial port to transmit peripheral operationinformation such as battery power, time, WIFI signal strength, keyoperation and knob operation to the CPU core board 9 for furtherprocessing.

The CPU core board 9 may be connected with a memory card through theinterface board 10. In the embodiment of the present invention, with thefield of view acquisition unit 1 as an observation entrance direction, amemory card slot is disposed at the left side of the CPU core board 9,the memory card is inserted in the memory card slot, information may bestored in the memory card, and the memory card may automatically upgradea software program built in the system.

With the field of view acquisition unit 1 as the observation entrancedirection, a USB interface is disposed on a side of the memory card sloton the left side of the CPU core board 9, and by means of the USBinterface, the system may be powered by an external power supply orinformation of the CPU core board 9 is output.

With the field of view acquisition unit 1 as the observation entrancedirection, an HDMI interface is disposed on a side of the USB interfaceat the side of the memory card slot on the left side of the CPU coreboard 9, and real-time video information may be transmitted to ahigh-definition display device of the HDMI interface through the HDMIinterface for display.

A housing is internally provided with a battery compartment 7, a batterypack 13 is disposed within the battery compartment, an elastic sheet isdisposed within the battery compartment 7 for fastening the battery pack13, the battery compartment 7 is disposed in the middle in the housing,and a cover of the battery compartment may be opened by the side of thehousing to realize replacement of the battery pack 13.

A line welding contact is disposed at the bottom side of the batterycompartment 7, the contact is connected with the elastic sheet insidethe battery compartment, the contact of the battery compartment 7 iswelded with a wire with a wiring terminal, and is connected with theinterface board 10 for powering the interface board 10, the CPU coreboard 9, the electro-optical conversion board 8, the function operationboard 11, the display conversion board 12 and the display unit 5.

The display unit 5 is a display screen, the display unit 5 is connectedwith the interface board 10 through the display conversion board 12,thereby communicating with the CPU core board 9; the CPU core boardtransmits display data to the display unit 5 for display. The displayunit 5 includes a display screen and a touch screen, wherein the displayscreen and the touch screen are glued by adopting a pressure sensitiveadhesive, the touch screen may directly operate a software interface forsetting and selecting a function. The display unit 5 is of a designmanner which may be adjusted up and down as well as left and right, andmay be adjusted in a suitable position according to different heights,illumination angles and the like to ensure observation comfort andclarity.

The processed information of the electro-optical conversion unit isdisplayed on the display screen, while information for auxiliaryanalysis and operation instructions is displayed on the display screenas well.

An external key 3 is disposed at the top of the housing, and connectedonto the interface board 10 through the function operation board 11 onthe inner side of the housing, and functions of turning the device on oroff: photographing and video-recording may be realized by touching andpressing the external key.

A rotary encoder 14 with a key function is disposed on one side, whichis close to the external key 3, on the top of the housing, and therotary encoder 14 is connected with the function operation board 11inside the housing. The rotary encoder controls functions such asfunction switching, magnification data adjustment, information setting,operation derivation and transmission.

A wireless transmission interface antenna 4 is disposed at a position,which is close to the rotary encoder 14, on the top of the housing, theinterface antenna is connected with the function operation board 11inside the housing, and the function operation board has a wirelesstransmission processing circuit which is responsible for transmitting aninstruction and data transmitted by the CPU core board as well asreceiving instructions transmitted by networking devices such as anexternal mobile terminal.

With the field of view acquisition unit 1 as the observation entrancedirection, a focusing knob 15 is disposed at one side, which is close tothe field of view acquisition unit 1, on the right side of the housing,and the focusing knob 15 adjusts focusing of the field of viewacquisition unit 1 by a spring mechanism, so as to achieve the purposeof clearly observing an object under different distances and differentmagnifications.

A tripod interface 6 is disposed at the bottom of the housing for beingfixed on the tripod.

An external leather track 2 is disposed at the top of the field of viewacquisition unit 1 of the housing, and the external leather track 2 andthe field of view acquisition unit 1 are designed with the same opticalaxis and fastened by screws. The external leather track 2 is designed ina standard size and may be provided with an object fixedly provided witha standard Picatinny connector, and the object includes a laser rangefinder, a fill light, a laser pen, and the like.

By applying the above spotting scope, an observer does not need toobserve by a monocular eyepiece. Front target surface information isdisplayed directly in a high-definition liquid crystal display of thespotting scope in an image video form through the electro-opticalconversion circuit. By means of an optical magnification and electronicmagnification combination manner, a distant object is displayed in amagnified manner, and the target surface information may be clearly andcompletely seen through the screen.

By applying the above spotting scope, without manual datainterpretation, through related technologies of image recognition andpattern recognition, old points of impact are automatically filtered,information of newly-added points of impact is reserved, and a specificdeviation value and a specific deviation direction of each bullet from ablank at the time of this shooting are automatically calculated;shooting accuracy information may be stored in a database, data in thedatabase may be locally browsed, and shooting within a period of timemay be self-evaluated according to data time, the spotting scope systemmay automatically generate a shooting accuracy trend within a period oftime, and provide an intuitive accuracy expression for training in agraph form; and the above text data and the above graph data may bederived locally for being printed so as to be further analyzed and used.

By applying the above spotting scope, the entire process may becompletely recorded in a video manner, and the video record may be usedas a sharing video between enthusiasts, the video is uploaded to a videosharing platform via Internet, and the video may be locally placed backfor a user to play back the entire shooting and accuracy analyzingprocess.

By applying the above spotting scope, it may be linked with a mobileterminal through the network. A linkage mode includes: with the spottingscope as a hotspot, the mobile device is connected with it; and furtherincludes: the spotting scope and the mobile device are connected to thesame wireless network for connection.

By applying the above spotting scope, it is possible to output real-timeimage data to a high-definition large-size liquid crystal displaytelevision or a television wall by wired transmission, so that allpeople in a certain area can watch on-site at the same time.

The present embodiment further provides an analysis method of anelectronic spotting scope for automatically analyzing a shootingaccuracy. The analysis method includes the following steps.

(1) Electro-optical conversion, namely, converting an optical imageobtained by the spotting scope into an electronic image.

(2) Target paper area extraction, namely, extracting a target paper areafrom the electronic image.

A target paper area of interest is extracted from a global image, andthe interference of complex background environment information iseliminated. The target paper area extraction method is a targetdetection method based on adaptive threshold segmentation. The detectionmethod is high in speed of determining the threshold, and better inperformance for a variety of complex conditions, and guarantees thesegmentation quality. The detection method sets t as a segmentationthreshold of the foreground and the background by employing an idea ofmaximizing an interclass variance, wherein a ratio of the number offoreground points to the image is w0, an average gray value is u0; and aratio of the number of background points to the image is w1, an averagegray value is u1, and u is set as the total average gray value of theimage, then:u=w0*u0+w1*u1

t is traversed from the minimum gray level value to the maximum graylevel value, when a value oft lets a value of g to be maximum, t is anoptimal segmentation threshold;g=w0*(u0−u)² +w1*(u1−u)².

A process for executing the target paper extraction method is as shownin FIG. 4. The target paper extraction method includes four steps,namely, image mean filtering, determination of the segmentationthreshold by using an Otsu threshold method, determination of acandidate area by threshold segmentation, determination and truncationof the minimum contour by using a contour tracing algorithm.

(21) Image mean filtering.

The image is subjected to large-scale mean filtering to eliminate gridinterference on a target paper, highlighting a circular target paperarea. By taking a sample with a size 41*41 as an example, a calculationmethod is as follows:

${{g\left( {x,y} \right)} = {\frac{1}{41*41}{\sum\limits_{i = {- 20}}^{i = 20}{\sum\limits_{j = {- 20}}^{j = 20}{{orgin}\mspace{14mu}\left( {{x + i},{y + j}} \right)}}}}};$

wherein g(x,y) represents a filtered image, x represents a horizontalcoordinate of a center point of a sample on a corresponding point on theimage, y represents a longitudinal coordinate of the center point of thesample on the corresponding point on the image, i represents a pixelpoint horizontal coordinate index value between −20 and 20 relative tox, and j represents a pixel point longitudinal coordinate index valuebetween −20 and 20 relative to y.

(22) Determination of the segmentation threshold by using an Otsuthreshold method.

Threshold segmentation segments the image into the background and theforeground by using the adaptive Otsu threshold segmentation (OTSU)method according to a gray property of the image. The greater a variancebetween the background and the foreground is, the greater the differencebetween the two parts of the image is. Therefore, for the image I(x, y),the segmentation threshold of the foreground and the background is setas Th, a ratio of pixel points belonging to the foreground to the wholeimage is w2, and its average gray level is G1; a ratio of pixel pointsbelonging to the background to the whole image is w3, and its averagegray level is G2, the total average gray level of the image is G_Ave, aninterclass variance is g, a size of the image is M*N, in the image, thenumber of pixels with gray level values smaller than the threshold isdenoted as N1, and the number of pixels with gray level values greaterthan the threshold is denoted as N2, then

${{w\; 2} = \frac{N\; 1}{M*N}};$ ${{w\; 3} = \frac{N\; 2}{M*N}};$M * N = N 1 + N 2; w 2 + w 3 = 1; G_Ave = w 2 * G 1 + w 3 * G 2;g=w2*(G_Ave−G1)² +w3*(G_Ave−G2)²;

the resultant equivalence formula is as follows:g=w2*w3*(G1−G2)²;the segmentation threshold th when the interclass variance g is maximummay be obtained by employing a traversing method.

(23) Segmentation of the filtered image in combination with thedetermined segmentation threshold th.

${g\left( {x,y} \right)} = \left\{ {\begin{matrix}{255,{{{Input}\left( {x,y} \right)} \geq {Th}}} \\{0,{{{Input}\left( {x,y} \right)} < {Th}}}\end{matrix};} \right.$

a binary image segmented into the foreground and the background isobtained.

(24) Determination and truncation of the minimum contour by employing acontour tracing algorithm.

Contour tracing employs a vector tracing method of a Freeman chain code,which is a method for describing a curve or boundary by usingcoordinates of a starting point of the curve and direction codes ofboundary points. The method is a coded representation method of aboundary, which uses a direction of the boundary as a coding basis. Inorder to simplify the description of the boundary, a method fordescribing a boundary point set is employed.

Commonly used chain codes are divided into a 4-connected chain code anda 8-connected chain code according to the number of adjacent directionsof a center pixel point. The 4-connected chain code has four adjacentpoints, respectively in the upper side, the lower side, the left sideand the right side of the center point. The 8-connected chain codeincreases 4 inclined 45° directions compared with the 4-connected chaincode, because there are eight adjacent points around any one pixel, andthe 8-connected chain code just coincides with an actual situation ofthe pixel points, information of the center pixel point and its adjacentpoints may be accurately described. Accordingly, this algorithm employsthe 8-connected chain code, as shown in FIG. 2.

A 8-connected chain code distribution table is as shown in Table 1:

TABLE 1 8-connected chain code distribution table 3 2 1 4 P 0 5 6 7

As shown in FIG. 3, a 9×9 bitmap is given, wherein a line segment with astarting point S and an end point E may be represented asL=43322100000066.

A FreemanList structure is customized in combination with a customstructure body:

-   {-   int x;-   int y;-   int type;-   FreemanList* next;-   }

whether the head and the tail of a chain code structure are consistentor not is determined, so that whether the contour is complete or not isdetermined.

An image of the target paper area is obtained and then stored.

(3) Detecting points of impact.

The point of impact detection method is a background subtraction-basedpoint of impact detection method. The method includes: detecting pointsof impact from the image of the target paper area, and determining aposition of a center point of each of the points of impact. This methodstores the previous target surface pattern, and then uses the currenttarget surface pattern for pixel-level subtraction with the previoustarget surface pattern. Since images of two frames may have a pixeldeviation during the perspective correction calculation of the image, adownsampling method is employed to count an area with 2 pixels as a steplength, wherein the area is obtained by calculating the downsampled graylevel map with the minimum gray level value as the pixel gray levelvalue within a 2*2 pixel area, with a gray level greater than 0; andthis area is subjected to contour detection to obtain information ofnewly generated points of impact pattern.

The point of impact detection method is high in processing speed whencomparison is performed by utilizing pixel-level subtraction of theimages of the previous frame and the following frames, and can ensurethat positions of the newly generated points of impact are returned.

The point of impact detection method is performed as follows.

(31) Storing an original target paper image

Data of the original target image is stored and read in a cache toenable the original target image to serve as a reference target paperimage. If a target subjected to accuracy calculation is shot againduring shooting, the target paper area stored at the time of the lastaccuracy calculation is used as a reference target paper image.

(32) Performing pixel-level subtraction on the image subjected to theprocessing of the steps (1) to (2) and the original target paper imageto obtain a difference position.

The pixel difference threshold of the images of the previous frame andthe following frame is set. A setting result is 255 when a pixeldifference exceeds the threshold, and the setting result is 0 when thepixel difference is lower than the threshold.

${{result}\left( {x,y} \right)} = \left\{ {\begin{matrix}{255,{{{{grayPre}\left( {x,y} \right)}{\_ grayCur}\left( {x,y} \right)} \geq {threshold}}} \\{0,{{{{grapPre}\left( {x,y} \right)}{\_ grayCur}\left( {x,y} \right)} < {threshold}}}\end{matrix};} \right.$

a specific threshold may be obtained through debugging, with a set rangegenerally between 100 and 160.

(33) Performing contour tracing on the image generated in the step (32)to obtain a point of impact contour and calculating a center point ofeach of the points of impact.

Contour tracing is performed by a Freeman chain code to calculate anaverage to obtain the center point of each of the points of impact, andits calculation formula is as follows:

${{Centerx}_{i} = {\frac{1}{n}{\sum\limits_{i \in {FreemanList}}{{FreemanList}_{i} \cdot x}}}};$${{Centery}_{i} = {\frac{1}{n}{\sum\limits_{i \in {FreemanList}}{{FreemanList}_{i} \cdot y}}}};$

Centerx_(i) represents a center x-axis coordinate of an i-th point ofimpact, Centery_(i) represents a center y-axis coordinate of the i-thpoint of impact, Freemanlist_(i) represents a contour of the i-th pointof impact; and n is a positive integer.

A process for performing the point of impact detection method is asshown in FIG. 12.

(4) Calculating a deviation.

A horizontal deviation and a longitudinal deviation between each of thepoints of impact and a center of the target paper are detected to obtaina deviation set.

Pixel-level subtraction is performed on the target paper area and theelectronic reference target paper to detect the points of impact, andthe center point of each of the points of impact is calculated, and theshooting accuracy is determined according to the deviation between thecenter point of each of the points of impact and the center point of thetarget paper area.

Embodiment 2

This embodiment is substantially the same as the embodiment 1, with adifference lying in including a target paper area correction step afterthe target paper area is extracted.

In combination with FIG. 11, the process of target paper area correctionis described in detail below.

Due to the pasting of the target paper as well as an angular deviationbetween the spotting scope and the target paper when the image isacquired, an effective area of the extracted target paper may be tiltedso that the acquired image is non-circular. In order to ensure that thecalculated deviation value of each of the points of impact is higher inaccuracy, perspective correction is performed on the target paper imageto correct the outer contour of the target paper into a regularlycircular contour. The target paper area correction method is a targetpaper image correction method based on an elliptical end point, and themethod obtains the edge of the image by using a Canny operator. Sincethe target paper image almost occupies the whole image, maximumelliptical contour fitting is performed by using Hough transform in thecase of small parameter change range to obtain the maximum ellipticequation. There are cross lines in the target paper image, and a numberof points of intersection with the ellipse, and these points ofintersection correspond to the uppermost point, the lowermost point, therightmost point and the leftmost point of the largest elliptical contourin a standard graph, respectively. Straight line fitting of the crosslines is performed by using Hough transform. In an input sub-image, anintersection point set of the cross lines and the ellipse is obtained,and a perspective transformation matrix is calculated in combinationwith a point set of the same positions of the template.

The target paper area correction method may quickly obtain an outermostellipse contour parameter by using the Hough transform. Meanwhile, aHough transform straight line detection algorithm under polarcoordinates can quickly obtain a straight line parameter as well, sothat the method can quickly correct the target paper area.

The target paper area correction method is performed as follows.

(51) Performing edge detection by using a Canny operator.

The method includes five parts of conversion of RGB into a gray levelmap, Gaussian filtering to suppress noise, first-order derivativecalculation of a gradient, non-maximum suppression, detection andconnection of the edge by a double-threshold method.

Conversion of RGB into a Gray Level Map

Gray level conversion is performed by a conversion ratio of RGB into agray level to convert a RGB image into a gray level map (three-primarycolors of R, G and B are converted to gray level values), and itsprocess is performed as follows:Gray=0.299R+0.587G+0.114B

Gaussian Filtering of the Image.

Gaussian filtering is performed on the converted gray level map tosuppress noise of the converted image, σ is set as a standard deviation,at this time, a size of the template is set as (3*σ+1)*(3σ+1) accordingto a Gaussian loss minimization principle, x is set as a horizontalcoordinate deviating from the center point of the template, y is set asa longitudinal coordinate deviating from the center point of thetemplate, and K is set as a weight value of a Gaussian filteringtemplate, and its process is performed as follows:

${{K = {\frac{1}{2\;\pi\;\sigma*\sigma}e^{- \frac{{x*x} + {y*y}}{2\;\sigma*\sigma}}}};}.$

Calculation of a gradient magnitude and a gradient direction by using afinite difference of first-order partial derivative.

A convolution operator:

${S_{x} = \begin{bmatrix}{- 1} & 1 \\{- 1} & 1\end{bmatrix}};$ ${S_{y} = \begin{bmatrix}1 & 1 \\{- 1} & {- 1}\end{bmatrix}};$

the gradient is calculated as follows:P[i,j]=(f[i,j+1]−f[i,j]+f[i+1,j+1]−f[i+1,j])/2;Q[i,j]=(f[i,j]−f[i+1,j]+f[i,j+1]−f[i+1,j+1])/2;M[i,j]=√{square root over (P[i,j] ² +Q[i,j] ²)};θ[i,j]=tan⁻¹(Q[i,j]/P[i,j]);

Non-Maximum Suppression.

The method is to find the local maximum of the pixel point, the graylevel value corresponding to a non-maximum point is set to 0, so thatmost of non-marginal points are eliminated.

It may be known from FIG. 5, it is necessary to determine whether thegray level value of the pixel point C is maximum within its 8-valuedneighborhood when non-maximum suppression is performed. In FIG. 5, adirection of a line dTmpIdTmp2 in FIG. 5 is a gradient direction of thepoint C, in this way, it may be determined that its local maximum valueis definitely distributed on this line, that is, in addition to thepoint C, values of the two points of intersection dtmp1 and dTmp2 in thegradient direction will be local maximums. Therefore, determining thegray level value of the point C and the gray level values of these twopoints may determine whether the point C is a local maximum gray pointwithin its neighborhood. If the gray level value of the point C is lessthan any of these two points, then the point C is not the local maximum,and it may be excluded that the point C is an edge.

Detection and Connection of the Edge by Adopting a Double-ThresholdAlgorithm.

A double-threshold method is used to further reduce the number ofnon-edges. A low threshold parameter Lthreshold and a high thresholdparameter Hthreshold are set, and the two constitute a comparisoncondition, the high threshold and numerical values above the highthreshold are converted into 255 values for storage, numerical valuesbetween the low threshold and the high value are uniformly convertedinto 128 values for storage, and other values are considered as non-edgedata and replaced by 0.

${g\left( {x,y} \right)} = \left\{ {\begin{matrix}{0,{{g\left( {x,y} \right)} \leq {Lthreshold}}} \\{255,{{g\left( {x,y} \right)} \geq {Hthreshold}}} \\{128,{{Lthreshold} < {g\left( {x,y} \right)} < {Hthreshold}}}\end{matrix};} \right.$

edge tracing is performed by utilizing the Freeman chain code again tofilter out edge points with small length.

(52) Fitting the cross lines by using the Hough transform under thepolar coordinates to obtain a linear equation.

The Hough transform is a method for detecting a simple geometric shapeof a straight line and a circle in image processing. One straight linemay be represented as y=kx+b by using a Caresian coordinate system, thenany one point (x,y) on the straight line is converted into a point in ak-b space, in other words, all non-zero pixels on the straight line inan image space are converted into a point in the k-b parameter space.Accordingly, one local peak point in the parameter space may correspondto one straight line in an original image space. FIG. 6 shows theoriginal point (x₀, y₀) in the Caresian coordinate system. Since a slopehas an infinite value or an infinitesimal value, the straight line isdetected by using a polar coordinate space. In a polar coordinatesystem, the straight line can be represented as follows:ρ=x*cos θ+y*sin θ

It may be known from the above formula in combination with FIG. 7, aparameter ρ represents a distance from an origin of coordinates to thestraight line, each set of parameters ρ and θ will uniquely determineone straight line, and only if the local maximum value serves as asearch condition in the parameter space, a straight line parameter setcorresponding to the local maximum may be acquired. FIG. 8 showsstraight lines 1, 2, 3, and 4 passing through the original point in apolar coordinate system.

After the corresponding straight line parameter set is obtained, thenon-maximum suppression is used to reserve a parameter of the maximum.

(53) Calculating four points of intersection of the cross lines with theellipse.

L1 and L2 linear equations are known, as long as points of intersectionwith an outer contour of the ellipse are searched in a straight linedirection to obtain four intersection point coordinates (a, b), (c, d),(e, f), (g, h), as shown in FIG. 9.

(54) Calculating a perspective transformation matrix parameter for imagecorrection.

The four points of intersection are used to form four point pairs withcoordinates of four points defined by the template, and the target paperarea is subjected to perspective correction.

The perspective transformation is to project the image to a new visualplane, and a general transformation formula is in the following, wherea_(ij) are coefficients that forms the perspective transformationmatrix:

$\left\lbrack {x^{\prime},y^{\prime},w^{\prime}} \right\rbrack = {\left\lbrack {u,v,w} \right\rbrack\begin{bmatrix}a_{11} & a_{12} & a_{13} \\a_{21} & a_{22} & a_{23} \\a_{31} & a_{32} & a_{33}\end{bmatrix}}$

u and v are coordinates of an original image, corresponding tocoordinates x′ and y′ of the transformed image. In order to construct athree-dimensional matrix, auxiliary factors w, w′ are added, w is takenas 1, and w′ is a value of the transformed w, whereinx′=x/w;y′=y/w;the above formulas may be equivalent to:

${x^{\prime} = {\frac{x}{w} = \frac{{a_{11}*u} + {a_{21}*v} + a_{31}}{{a_{13}*u} + {a_{23}*v} + a_{33}}}};$${y^{\prime} = {\frac{y}{w} = \frac{{a_{12}*u} + {a_{22}*v} + a_{32}}{{a_{13}*u} + {a_{23}*v} + a_{33}}}};$

accordingly, the perspective transformation matrix can be obtained bygiving the coordinates of the four points corresponding to theperspective transformation. After the perspective transformation matrixis obtained, the image or the pixel point may be subjected toperspective transformation. As shown in FIG. 10:

in order to facilitate the calculation, we have simplified the aboveformula, (a₁, a₂, a₃, a₄, a₅, a₆, a₇, a₈) is set as 8 parameters of theperspective transformation, and the above formulas are equivalent to:

${x^{\prime} = \frac{{a_{1}*x} + {a_{2}*y} + a_{3}}{{a_{7}*x} + {a_{8}*y} + 1}};$${y^{\prime} = \frac{{a_{4}*x} + {a_{5}*y} + a_{6}}{{a_{7}*x} + {a_{8}*y} + 1}};$

wherein (x,y) represents a to-be-calibrated map coordinate, (x′,y′)represents a calibrated map coordinate, that is, a template mapcoordinate. The above formulas are equivalent to:a ₁ *x+a ₂ *y+a ₃ −a ₇ *x*x′−a ₈ *y*x′−x′=0;a ₄ *x+a ₅ *+a ₆ −a ₇ *x*y′−a ₈ *y*y′−y′=0:

the above formulas are converted into a matrix form:

${{\begin{bmatrix}x & y & 1 & 0 & 0 & 0 & {- {xx}^{\prime}} & {- {yx}^{\prime}} \\0 & 0 & 0 & x & y & 1 & {- {xy}^{\prime}} & {- {yy}^{\prime}}\end{bmatrix}\begin{bmatrix}a_{1} \\a_{2} \\a_{3} \\a_{4} \\a_{5} \\a_{6} \\a_{7} \\a_{8}\end{bmatrix}} = \begin{bmatrix}x^{\prime} \\y^{\prime}\end{bmatrix}};$

since there are 8 parameters, one point has two equation pairs, so thatonly 4 points can solve the corresponding 8 parameters. (x_(i),y_(i)) isset as a coordinate of a pixel point of a to-be-calibrated image,(x′_(i),y′_(i)) is set as a coordinate of a pixel point of a templatemap, i={1, 2, 3, 4}. Accordingly, the matrix form may be converted into:

${{\begin{bmatrix}x_{1} & y_{1} & 1 & 0 & 0 & 0 & {{- x_{1}}x_{1}^{\prime}} & {{- y_{1}}x_{1}^{\prime}} \\0 & 0 & 0 & x_{1} & y_{1} & 1 & {{- x_{1}}y_{1}^{\prime}} & {{- y_{1}}y_{1}^{\prime}} \\x_{2} & y_{2} & 1 & 0 & 0 & 0 & {{- x_{2}}x_{2}^{\prime}} & {{- y_{2}}x_{2}^{\prime}} \\0 & 0 & 0 & x_{2} & y_{2} & 1 & {{- x_{2}}y_{2}^{\prime}} & {{- y_{2}}y_{2}^{\prime}} \\x_{3} & y_{3} & 1 & 0 & 0 & 0 & {{- x_{3}}x_{3}^{\prime}} & {{- y_{3}}x_{3}^{\prime}} \\0 & 0 & 0 & x_{3} & y_{3} & 1 & {{- x_{3}}y_{3}^{\prime}} & {{- y_{3}}y_{3}^{\prime}} \\x_{4} & y_{4} & 1 & 0 & 0 & 0 & {{- x_{4}}x_{4}^{\prime}} & {{- y_{4}}x_{4}^{\prime}} \\0 & 0 & 0 & x_{4} & y_{4} & 1 & {{- x_{4}}y_{4}^{\prime}} & {{- y_{4}}y_{4}^{\prime}}\end{bmatrix}\begin{bmatrix}a_{1} \\a_{2} \\a_{3} \\a_{4} \\a_{5} \\a_{6} \\a_{7} \\a_{8}\end{bmatrix}} = \begin{bmatrix}x_{1}^{\prime} \\y_{1}^{\prime} \\x_{2}^{\prime} \\y_{2}^{\prime} \\x_{3}^{\prime} \\y_{3}^{\prime} \\x_{4}^{\prime} \\y_{4}^{\prime}\end{bmatrix}};$

let

$A = \begin{bmatrix}x_{1} & y_{1} & 1 & 0 & 0 & 0 & {{- x_{1}}x_{1}^{\prime}} & {{- y_{1}}x_{1}^{\prime}} \\0 & 0 & 0 & x_{1} & y_{1} & 1 & {{- x_{1}}y_{1}^{\prime}} & {{- y_{1}}y_{1}^{\prime}} \\x_{2} & y_{2} & 1 & 0 & 0 & 0 & {{- x_{2}}x_{2}^{\prime}} & {{- y_{2}}x_{2}^{\prime}} \\0 & 0 & 0 & x_{2} & y_{2} & 1 & {{- x_{2}}y_{2}^{\prime}} & {{- y_{2}}y_{2}^{\prime}} \\x_{3} & y_{3} & 1 & 0 & 0 & 0 & {{- x_{3}}x_{3}^{\prime}} & {{- y_{3}}x_{3}^{\prime}} \\0 & 0 & 0 & x_{3} & y_{3} & 1 & {{- x_{3}}y_{3}^{\prime}} & {{- y_{3}}y_{3}^{\prime}} \\x_{4} & y_{4} & 1 & 0 & 0 & 0 & {{- x_{4}}x_{4}^{\prime}} & {{- y_{4}}x_{4}^{\prime}} \\0 & 0 & 0 & x_{4} & y_{4} & 1 & {{- x_{4}}y_{4}^{\prime}} & {{- y_{4}}y_{4}^{\prime}}\end{bmatrix}$

${X = \begin{bmatrix}a_{1} \\a_{2} \\a_{3} \\a_{4} \\a_{5} \\a_{6} \\a_{7} \\a_{8}\end{bmatrix}};$ ${b = \begin{bmatrix}x_{1}^{\prime} \\y_{1}^{\prime} \\x_{2}^{\prime} \\y_{2}^{\prime} \\x_{3}^{\prime} \\y_{3}^{\prime} \\x_{4}^{\prime} \\y_{4}^{\prime}\end{bmatrix}};$

the above formula is as follows:AX=ba nonhomogeneous equation is solved to obtain a solution:X=A ⁻¹ b;

the corrected target paper area is obtained and then stored, and theimage of the corrected target paper area is applied at the time ofsubsequent ballistic point detection.

The invention claimed is:
 1. An analysis method for automaticallyanalyzing a shooting accuracy of an electronic spotting scope,comprising: obtaining, using the electronic spotting scope, an opticalimage containing a target paper, wherein the target paper contains oneor more points of impact; converting the optical image into anelectronic image; extracting a target paper area from the electronicimage; subtracting an electronic reference target paper from the targetpaper area to detect one or more points of impact; calculating a centerpoint of each of the one or more points of impact; and determining theshooting accuracy according to a deviation between the center point ofeach of the one or more points of impact and a center point of thetarget paper area, wherein the subtracting step comprises: subtractingthe electronic reference target paper from the target paper area toobtain a pixel difference image that indicates a difference at apixel-level between the target paper area and the electronic referencetarget paper, wherein the electronic reference target paper is anelectronic image of the target paper without a most recent point ofimpact; subjecting the pixel difference image to contour tracing toobtain a contour of the most recent point of impact; and calculating acenter of the contour of the most recent point of impact to obtain acenter point of the most recent point of impact.
 2. The analysis methodaccording to claim 1, further comprising correcting an outer contour ofthe target paper area to a circular shape using perspective correctionafter the extracting step and before the subtracting step.
 3. Theanalysis method according to claim 2, wherein the perspective correctioncomprises: obtaining an edge of the target paper area by using a Cannyoperator; performing maximum elliptical contour fitting on the edge byusing Hough transform to obtain a maximum elliptical equation;performing straight line fitting of cross lines on the edge by using theHough transform to obtain points of intersection with an uppermostpoint, a lowermost point, a rightmost point and a leftmost point of themaximum elliptical contour; combining the uppermost point, the lowermostpoint, the rightmost point, and the leftmost point of the maximumelliptical contour with four points at the same positions in aperspective transformation template to obtain a perspectivetransformation matrix; and performing perspective transformation on thetarget paper area by using the perspective transformation matrix.
 4. Theanalysis method according to claim 1, wherein the extracting stepcomprises: filtering the electronic image to eliminate grid interferenceon the target paper; segmenting the filtered electronic image into abackground and a foreground by using an adaptive Otsu thresholdsegmentation method according to a gray property of the electronicimage; and determining a minimum contour using a vector tracing methodand a geometric feature of a Freeman link code according to the imagesegmented into the foreground and background to obtain the target paperarea.
 5. The analysis method according to claim 1, wherein theelectronic reference target paper is an electronic image of a blanktarget paper or a target paper area that is previously extracted.
 6. Theanalysis method according to claim 1, wherein the deviation comprises alongitudinal deviation and a lateral deviation.
 7. The analysis methodaccording to claim 1, wherein the electronic spotting scope comprises anexterior structure, an internal portion of the exterior structuredefines an accommodating space, and the accommodating space houses afield of view unit, an electro-optical conversion device, a CPUprocessing unit, a display unit, a power supply, and a wirelesstransmission unit.
 8. The analysis method according to claim 7, whereinthe electronic spotting scope has an accuracy analysis module, whereinthe accuracy analysis module is configured to analyze a shootingaccuracy by adopting the analysis method.